home *** CD-ROM | disk | FTP | other *** search
/ Amiga News 95 / Amiga News 95.iso / dpat / dpat103 / dice / dcc / rexx / ced_errorparse.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1994-12-24  |  2.2 KB  |  97 lines

  1. /*
  2. **      $Id: TTX_ErrorParse.ttx,v 3.2 1994/02/21 17:29:35 JToebes Exp $
  3. **
  4. **      DICE Error Parsing Script.  Script for Oxxi TurboText (tm).
  5. **
  6. **  Notes: This assumes that your DCC:Config/DCC.Config file contains the
  7. **         following line:
  8. **  cmd= rx DCC:Rexx/TTX_ErrorParse.rexx %e "%c" "%f" "%0"
  9. */
  10.  
  11. /*************************************************************************
  12.  
  13. Version 3.21: le 28-11-94
  14.  
  15.     - Le script n'allait jamais jusqu'a la fin car une erreur etait
  16. interceptee par AREXX. Il y avait un debut de commentaire en trop.
  17.  
  18. **************************************************************************/
  19.  
  20.  
  21. /*** Ligne de debogage
  22.  
  23. trace all
  24. signal on break_c ***/
  25.  
  26. OPTIONS RESULTS
  27.  
  28. PARSE ARG EFile '"' Fn '" "' CurDir '" "' CFile '" "' VPort '"'
  29. IF VPort = '?' THEN VPort = ''
  30.  
  31. portname = 'DICE_ERROR_PARSER'  /* DICEHelp's port name */
  32.  
  33. if ~show('p',portname) then
  34.    do
  35.       address COMMAND 'RUN >NIL: <NIL: DError REXXSTARTUP'
  36.  
  37.       do i = 1 to 6
  38.          if ~show('p',portname) then
  39.             address COMMAND 'wait 1'
  40.       end
  41.  
  42.       if ~show('p',portname) then
  43.          do
  44.             say "Dice Error Parser (DERROR) program not found!"
  45.             address COMMAND 'type' EFile
  46.             exit
  47.          end
  48.    end
  49.  
  50.  
  51. /**
  52.  ** Get the error messages loaded in.
  53.  ** This will return a list of lines within the file that have
  54.  ** errors associated with them (if any)
  55.  **/
  56. ADDRESS DICE_ERROR_PARSER LOAD EFile '"'CurDir'" "'Fn'" "'VPort'"'
  57. LINES = RESULT
  58.  
  59. /**
  60.  ** go to the first error message
  61.  **/
  62.  
  63. ADDRESS DICE_ERROR_PARSER Current E
  64. IF rc ~= 0 THEN
  65.    DO
  66.       'DM No More Errors'
  67.       exit 0
  68.    END
  69.  
  70. IF E.LINE = 0 THEN
  71.    DO
  72.    IF LEFT(E.TEXT, 5) = 'DLINK' THEN
  73.       DO
  74.          TT = TRANSLATE(E.STRING, '-', '"')
  75.          /* This is a DLINK error, we need to handle it special */
  76.          SAY 'There were DLINK Errors'
  77.          ADDRESS COMMAND TYPE EFILE
  78.          exit 0
  79.       END
  80.    END
  81.  
  82. ADDRESS COMMAND 'ed' E.FPATH '-i'
  83. IF RC ~= 0 THEN
  84.    DO
  85.       Say 'Unable to open' E.FPATH
  86.       exit 0
  87.    END
  88.  
  89. do i = 1 to 6
  90.    if ~show('p','rexx_ced') then
  91.       address COMMAND 'wait 1'
  92. end
  93.  
  94. ADDRESS 'rexx_ced'
  95. 'jump to line' E.line    /* Jump straight to the line number. */
  96. 'DM' E.STRING
  97.